package object.Api;

public class PersonTest {
    public static void main(String[] args) {
        Person p = new Person("王武",15);
        System.out.println(p);
        System.out.println(p.hashCode());//29278709返回哈希码值


        Person p1 = new Person("zhangsan",11);
        Person p2 = new Person("zhangsan",11);

        System.out.println(p1==p2);
        System.out.println(p1.equals(p2));
        //返回对象的字节码对象
        System.out.println(p.getClass());
        //如果垃圾不被回收，就会造成内存溢出，就要有对应的垃圾回收机制finalize（），用于垃圾回收


    }
}
